let app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        page:1,
        currentTab:1,
        dotation:false,
        status_index:0,
    
      
    },  

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        let that = this;
       // var id = options.id;
       // this.getCustomer(id);
       let d = app.globalData;
        that.setData({
            platform:d.platform,    
          //  id:id,
            width:d.windowWidth,
            height:d.windowHeight,
            statusBarHeight:d.statusBarHeight,
            navHeight:app.globalData.navHeight,
            navHeight:d.navHeight,
            navWidth:d.navWidth,
            navRight:d.navRight,
            marginTop:d.navTitleTop,
            domain:app.globalData.domain,
            uploadUrl:d.uploadUrl,
          })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },
    goBack(){
        wx.navigateBack();
    },
    goto:function(e){
        console.log(e);
        var url = e.currentTarget.dataset.url;
        var index = e.currentTarget.dataset.index;
        var parent_id=wx.getStorageSync('parent_id');
        app.goto(url,index);
    },
    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {
        let that = this;
        this.getList();
    },
    getList(){
        let that = this;  
        var open=wx.getStorageSync('open');
        wx.request({
            headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
            data: {
              user_id:open.id,
              phone:open.phone
            
                
            },
            //method: 'POST',
            dataType: 'json',
            timeout: 30000,
            url: app.globalData.domain + 'wechat/customer/getCalendar',
            success: (res) => {
              console.log(res);
              var data = res.data;
             // var data = JSON.parse(data.input);
              console.log(data);
             
              that.setData({
                list:data.list
              })
            }
          
           })
    },
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})